package com.ewuyong.concurrence.example.immutable;

import com.ewuyong.concurrence.annotations.NotThreadSafe;
import com.ewuyong.concurrence.annotations.ThreadSafe;
import com.google.common.collect.Maps;
import lombok.extern.slf4j.Slf4j;

import java.util.Collections;
import java.util.Map;

@Slf4j
@ThreadSafe
public class ImmutableExample2 {

    public  final static int a = 1;

    public  static Map<Integer, Integer> map = Maps.newHashMap();

    static {
        map.put(1, 2);
        map.put(3, 5);
        map = Collections.unmodifiableMap(map);

    }


    public static void main(String[] args) {
        //map.put(1, 5);
        System.out.println("args = [" + map.get(1) + "]");
    }
}
